<?php
/**
 * 自动加载 class/interface  
 *
 * @filesource spl_autoload.func.php
 * @package MagicDB
 * @subpackage spl_autoload
 * @version $id: 0.1, utf8, Tue Dec 15 20:53:39 CST 2009
 * @author LD King <kldscs[at]gmail.com>
 * @copyright Copyleft (D.) 2007 - 2009 MiFunny China Inc.
 * @link http://mifunny.info/
 */
define('SPL_ROOT', dirname(__FILE__));
if(false === spl_autoload_functions()){
	if( function_exists('__autoload') ){
		spl_autoload_register('__autoload',false);
	}
}
spl_autoload_extensions('.php, .class.php, .interface.php');

// 自动加载 class/intarface
function classLoader($class){
	$file = SPL_ROOT.DIRECTORY_SEPARATOR.$class.'.class.php';
    if( file_exists($file) ){
        require_once $file;
    }else throw new LogicException("Error: SPL_AUTOLOAD_CLASS({$class}) Failed!");
}
spl_autoload_register('classLoader');

?>
